﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.ServiceProcess;
using Valentia.Kinection.DataTypes;

namespace Valentia.Kinection.Watchdog
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            //bool lockAquired = false;
            //using (System.Threading.Mutex objThread = new System.Threading.Mutex(true, "5b244045-db5a-4e92-8792-44b0eba3e26a", out lockAquired))
            //{
            //    if (!lockAquired)
            //    {
            //        MessageBox.Show(
            //            "Valentia Kinection Service Watchdog is already running", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            //        return;
            //    }

            //    //Application.EnableVisualStyles();
            //    //Application.SetCompatibleTextRenderingDefault(false);
            //    Application.Run(new frmKinectWatchDog());
            //}

            Logger.LogFolder = String.Empty;
            Logger.LoggingEnabled = true;
            Logger.ApplicationName = WatchdogService.ThisServiceName;

            WatchdogService watchDog = new WatchdogService();
            ServiceBase[] ServicesToRun = new ServiceBase[] { watchDog };
            ServiceBase.Run(ServicesToRun);
        }
    }
}
